import { defineStore } from 'pinia'

interface IProps {
  tabsActive: 'custom' | 'insert' | 'replace' | 'remove' | 'import'
  errMsg: IExcelErrMsg | undefined
  newFileNameForm: IForm
}

interface IForm {
  newFileName: string | undefined
}

const useFileRenamePropsStore = defineStore('fileRenamePropsStore', {
  state(): IProps {
    return {
      // 工作台当前激活 Tab
      tabsActive: 'custom',
      // Excel 导入错误提示消息
      errMsg: undefined,
      // 受控的 form,防止关键字频繁触发 tableData 内容更新
      newFileNameForm: {
        newFileName: undefined
      }
    }
  }
})

export default useFileRenamePropsStore
